#!/bin/bash
curl -X 'POST' \
  'http://localhost:7861/knowledge_base/upload_docs' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'files=@/home/FAST_DATA_MIRROR/Langchain-Chatchat-master/云鹰平台服务系统接口协议V1.8.4.pdf;type=application/pdf' \
  -F 'knowledge_base_name=test_sh' \
  -F 'override=false' \
  -F 'to_vector_store=true' \
  -F 'chunk_size=250' \
  -F 'chunk_overlap=50' \
  -F 'zh_title_enhance=False' \
  -F 'docs={"test.txt": [{"page_content": "custom doc"}]}' \
  -F 'not_refresh_vs_cache=false'
#  PDF :  -F "files=@path_to_your_pdf_file.pdf;type=application/pdf"
#  TXT :  -F 'files=@path_to_file2.txt;type=text/plain' \
echo ""
curl -H "Accept: application/json" -H "Content-Type: application/json" http://0.0.0.0:7861/knowledge_base/list_knowledge_bases
echo ""